<script>
  import userHeader from '@/components/header.vue'
  import fixed from '@/components/fixed.vue'
  import paganition from '@/components/paganition.vue'
  import deleteAlarm from '@/components/deleteAlarm.vue'
  import treeToArray from '@/page/test/index.js'
  import treeToArray2 from '@/page/test/catalog.js'
  import {strToHexCharCode,toFixedBit,dec2hex,formatTime,getNewDate,formatDateTime} from  '@/utils/index.js';
  import Clickoutside from 'element-ui/lib/utils/clickoutside';
  import {mapState} from 'vuex';
  export default({
    directives: { Clickoutside },
    filters:{
      returnUserName:function(val){
        for(var i in this.tableData2){
          if(this.tableData2[i].user_id ==val){
            return this.tableData2[i].real_name
          }
        }
      }
    },
    computed:{
      ...mapState({
        company_id:state =>state.app.loginState.company_id||sessionStorage.getItem('company_id'),
        company_name:state=>state.app.loginState.company_name||sessionStorage.getItem('company_name'),
        company_pid:state=>state.app.loginState.company_pid||sessionStorage.getItem('company_pid'),
        height:state=>state.app.height,
      }),
      getUserName(){
        return function (user_id) {
          for(var i in this.userTable){
            if(this.userTable[i].user_id ==user_id){
              return this.userTable[i].real_name
            }
          }
        }
      },
      companyName:function () {
        if(this.checkCompany!=''){
          for(var i in this.formatData){
            if(this.formatData[i].company_id ==this.checkCompany){
              return this.formatData[i].company_name;
            }
          }
        }else if(this.company_id){
          return this.company_name
        }
        else{
          return '评价公司'
        }
      },
      formatData2: function() {
        let tmp;
        if (!Array.isArray(this.tableData3)) {
          tmp = [this.tableData3]
        } else {
          tmp = this.tableData3
        };
        const func = this.evalFunc || treeToArray2
        const args = this.evalArgs ? Array.concat([tmp, true], this.evalArgs) : [tmp, true];
        for(var i in func.apply(null, args)){
          if(func.apply(null, args)[i].companyevaplan){
            if(func.apply(null, args)[i].companyevaplan.evaluation_finishtime){
              func.apply(null, args)[i].evaluation_finishtime =formatDateTime(func.apply(null, args)[i].companyevaplan.evaluation_finishtime)
            }
          }
        }
        console.log(func.apply(null, args))
        return func.apply(null, args)
      },
      formatData: function() {
        let tmp;
        if (!Array.isArray(this.formCompany)) {
          tmp = [this.formCompany]
        } else {
          tmp = this.formCompany
        }
        const func = this.evalFunc || treeToArray
        const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
        return func.apply(null, args)
      },
      editorStart_time(){
        return function (selectTypeArray) {
          return formatDateTime(selectTypeArray)
        }
      }
    },
    components:{
      userHeader,
      fixed,
      paganition,
      deleteAlarm,
    },
    data (){
      var checkWalk_through =(rule, value, callback) => {
        console.log(this.cxcsTemplate.name)
        if(this.cxcsTemplate.name==undefined ||this.cxcsTemplate.name==''||this.cxcsTemplate.name=='请选择模板'){
          return callback('请选择需要穿行测试底稿')
        }else{
          callback()
        }
      };
      var checkcompanyName =(rule, value, callback) => {
        if(value==undefined ||value==''){
          return callback('请选择需要评价的公司')
        }else{
          callback()
        }
      };
      var checkEvaplan =(rule, value, callback) => {
        if( value==undefined ||value==''){
          return callback('请输入评价类型名称')
        }else{
          callback()
        }
      };
      var checkcommentTime =(rule, value, callback) => {
        if(this.commentDuration&&this.commentDuration.length==2){
          this.start_time =parseInt(new Date(this.commentDuration[0]).getTime()/1000);
          this.end_time =parseInt(new Date(this.commentDuration[1]).getTime()/1000);
          console.log(this.start_time);
          console.log(this.end_time)
          callback()
        }else{
          return callback('请选择评价期间')
        }
      };
      return {
        evaluationplanTypeId:'',
        evaluationplan_supervisor:[],
        totalOaMessage:[],
        tempDataArr:[],
        loading:true,
        changeIndex:'',
        switchData:0,
        rowIndex1:'',
        rowIndex2:'',
        //添加评价类型或者编辑评价类型
        commentTitle:"添加评价类型",
        isEditor:false,
        //分页器相关data
        pageCount:0,
        prev:'',
        next:'',
        self_identify:'',
        jumper:'',
        total_messages:{},
        editorPage:1,
        companyForm:false,
        commentDuration:[],
        cxscArr:[],
        cxcsRules:{
          walk_through:[
            { required: true,validator:checkWalk_through}
          ]
        },
        editorPlanShow:false,
        start_time:'',
        end_time:'',
        pickerOptions2: {
          disabledDate(time) {
            return time.getTime() < Date.now() - 8.64e7;
          },
        },
        planTime:'',
        dateDuration:'',
//        checkedCities1:[],
        checkCompany:"",
        tableData3: [

        ],
        tableData2:[],
//        编辑评价类型信息
        evaplan_type:{},
        companyData:{},
        //选择评价公司验证
        choiseCompany:
          {
            selectCompany:[
              { required: true,validator:checkcompanyName}
            ]
          },
        //添加评价计划验证
        commentType:{
          evaplan_type_name:[
            { required: true,validator:checkEvaplan}
          ],
          commentTime:[
            { required: true,validator:checkcommentTime}
          ]
        },
        hideUl:false,
        dialogFormVisible2:false,
        dialogFormVisible3:false,
        dialogFormVisible:false,
        formLabelWidth:'160px',
        radioStatus:1,
        radio:1,
        categyType:"评价类型",
        title:'审核人员',
        dialogFormVisible4:false,
        formMenber:{},
        formCompany:[],
        selectTypeArray:[],
        selectTypeArray2:[],
        typeId:'',
        commentTypeForm:{},
        multipleSelection:[],
        multipleSelection2:[],
        userTable:[],
        tempArr:[
          {
            prco_id:'',
            walk_through:'',
            evaluator:'',
            auditor:'',
            evaluation_finishtime:''
          }
        ],
        tempArr2:[
          {
            prco_id:'',
            walk_through:'',
            evaluator:'',
            auditor:'',
            evaluation_finishtime:''
          }
        ],
        clickIndex:'',
        roleType:[],
        form: {
          name: '',
          desc:'',
          region:''
        },
        cxcsTemplate:{
          name:"请选择模板",
        },
        pageTemplate:1,
        minLength:0,
        pageSize:1,
        total:0,
        currentPage:1,
        pageCount:0,
        evaluationplanTypeName:'',
      }
    },
    methods: {
      //关闭评价类型
      handleClose2(){
        this.dialogFormVisible =false;
        console.log(this.$refs.commentTypeForm);
        this.commentTypeForm={}
        this.$refs.commentTypeForm.resetFields();
      },
      //关闭选择评价人员
      handleClose1(){
        this.dialogFormVisible3 =false;
      },
      //分页状态改变
      currentChange(val){
        this.page =val;
        this.getComentTypeList3(this.page)
      },
//修改还未开始的日期
      modifyDate(val){
        this.multipleSelection= [...this.multipleSelection,this.modyfyData(val)];
        console.log(this.multipleSelection)
        console.log(val)
      },
      modyfyData(val){
        if(this.multipleSelection.length){
          for(var i in this.multipleSelection){
            if(this.multipleSelection[i].prco_id==val.prco_id){
              return ''
            }else{
              return val
            }
          }
        }else{
          return val
        }
      },
      getformatData() {
        let tmp;
        if (!Array.isArray(this.tableData3)) {
          tmp = [this.tableData3]
        } else {
          tmp = this.tableData3
        };
        const func = this.evalFunc || treeToArray2
        const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll];
        return func.apply(null, args)
      },
      getUserName2(val){
        if(this.tableData2){
          for(var i in this.tableData2){
            console.log(this.tableData2[i].user_id)
            if(this.tableData2[i].user_id ==val){
              return this.tableData2[i].real_name
            }
          }
        }
      },
      getUserName3(val){
        if(this.tableData2){
          for(var i in this.tableData2){
            console.log(this.tableData2[i].user_id)
            if(this.tableData2[i].user_id ==val){
              return this.tableData2[i].user_name
            }
          }
        }
      },


      //clickoutside
      clickhideul(){
        this.hideUl=false;
      },
      //穿行测试底稿选择提交
      confirmAddCxcs(formName){
        this.$refs[formName].validate((valid) => {
          if (valid) {
//              this.cxcsTemplate={};
            console.log(this.multipleSelection);
            if(this.formatData2[this.clickIndex].companyevaplan){
              console.log(this.cxcsTemplate)
              this.formatData2[this.clickIndex].companyevaplan.walk_through =this.cxcsTemplate.name;
              var tempformatData2 =this.formatData2[this.clickIndex];
            }else{
              this.formatData2[this.clickIndex].companyevaplan={
                walk_through :this.cxcsTemplate.name
              };
              var tempformatData2 =this.formatData2[this.clickIndex];
            }
            this.$set(this.formatData2,this.clickIndex,tempformatData2);
//            var companyevaplan ={
//                'walk_through':this.cxcsTemplate.name
//            };
//            this.$set(this.formatData2[this.clickIndex],"companyevaplan.walk_through",this.cxcsTemplate.name);
            this.dialogFormVisible4 =false;
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      //选择评价点
      selectComment(val,row){
        console.log(row)

        if(row.prco_id){
          if(val){
            //添加相关信息
            this.multipleSelection.push(row);
            console.log(this.multipleSelection)
            console.log(this.multipleSelection.length);
            console.log(this.tempArr.length);
            if(row.index==this.multipleSelection2.index){
//                alert(123)
              for(var i  in this.multipleSelection2){
                if(row.index==this.multipleSelection2[i].index){
                  this.tempArr.push(...this.multipleSelection2[i])
                }
              }
            }else{
              console.log(this.tempArr)
              this.tempArr[this.tempArr.length]={
                prco_id:'',
                walk_through:'',
                evaluator:'',
                auditor:'',
                evaluation_finishtime:''
              };
              console.log(this.tempArr)
            }
            for(var i in this.multipleSelection){
              for(var  k in this.formatData2){
                if(this.formatData2[k].element_id==this.multipleSelection[i].element_id){
                  this.$set(this.formatData2[this.multipleSelection[i].index],"disabled",true)
                }
              }
            }
          }else{
            console.log(this.tempArr)
            //剔除相关信息
            for(var i in this.multipleSelection){
              if(this.multipleSelection[i].prco_id ==row.prco_id){
                console.log(i);
                console.log(this.multipleSelection[i].index);
                this.$set(this.formatData2[this.multipleSelection[i].index],"disabled",false);
                this.multipleSelection.splice(i,1);
                this.tempArr.splice(i,1);
              }
            };
          }
        };
        console.log(this.multipleSelection)
        console.log(this.multipleSelection2)

      },
      productPlan(){
        if(!this.evaluationplanTypeId){
          this.evaluationplanTypeId =this.selectTypeArray2[0].evaplan_type_id
        }
        console.log(this.multipleSelection);
        console.log(this.tempArr);
        for(var i=0;i<this.multipleSelection.length;i++){
          if(!this.multipleSelection[i].companyevaplan){
            this.$alert('请完善勾选项信息','提示');
            return false
          }

          for(var k in this.formatData2){
            if(this.formatData2[k].index ==this.multipleSelection[i].index){
//                    console.log(this.multipleSelection[i].dateTimer)
              if(!this.multipleSelection[i].companyevaplan.evaluator){
                this.$alert('请完善计划人员或者评价人员','提示');
                return false
              }
              if(!this.multipleSelection[i].prco_id){
                this.$alert('请选择评价点','提示');
                return false
              }
//                    console.log(parseInt((this.multipleSelection[i].dateTimer).getTime()/1000));
              if(this.multipleSelection[i].dateTimer){
                this.tempArr[i].evaluation_finishtime =parseInt((this.multipleSelection[i].dateTimer).getTime()/1000);
              }else if(this.multipleSelection[i].companyevaplan.evaluation_finishtime){
                console.log(i)
                console.log(this.multipleSelection[i].companyevaplan);
                console.log(this.tempArr[i]);
                if(this.tempArr[i]== undefined){
                  break;
                }else{
                  this.tempArr[i].evaluation_finishtime =this.multipleSelection[i].companyevaplan.evaluation_finishtime;
                }
              }
              console.log(i)
              this.tempArr[i].evaluator =this.multipleSelection[i].companyevaplan.evaluator;
              this.tempArr[i].auditor   =this.multipleSelection[i].companyevaplan.auditor;
              this.tempArr[i].prco_id   =this.multipleSelection[i].prco_id;
              if(this.multipleSelection[i].companyevaplan.walk_through){
                this.tempArr[i].walk_through =this.multipleSelection[i].companyevaplan.walk_through;
              }
              else{
                this.tempArr[i].walk_through =0;
              }
            }
          }
        }
        console.log( this.tempArr);
        if(this.multipleSelection.length==0){
          this.$alert('请选择评价点','提示');
          return false
        }else{
          var total_messages=[];
          let totalLength =this.multipleSelection.length;
          console.log('```````````````');
          console.log(this.multipleSelection);
          console.log('!!!!!!!!!!!!!!!!!');
          console.log(this.multipleSelection);
          console.log(totalLength)
          for(var i=0;i<totalLength;i++){
            total_messages[i]={
              mess_receiver:this.multipleSelection[i].companyevaplan.evaluator,
              mess_type:1,
              mess_link:'/progressTest?evaluationplanTypeId='+this.evaluationplanTypeId+"&evaluationplanTypeName="+this.evaluationplanTypeName
            };
//            +'&evaluationplanTypeName='+
            this.totalOaMessage[i]={
              mess_receiver:this.getUserName3(this.multipleSelection[i].companyevaplan.evaluator),
              mess_type:1,
              mess_link:'/progressTest?evaluationplanTypeId='+this.evaluationplanTypeId+"&evaluationplanTypeName="+this.evaluationplanTypeName
            }
          };
          console.log(total_messages)
          console.log(this.evaluationplan_supervisor)
          //给所有的对应主管发消息
          for(var ki=0;ki<this.evaluationplan_supervisor.length;ki++){
            total_messages[ki+totalLength]={
              mess_receiver:this.evaluationplan_supervisor[ki].user_id,
              mess_type:1,
              mess_link:'/progressTest?evaluationplanTypeId='+this.evaluationplanTypeId+"&evaluationplanTypeName="+this.evaluationplanTypeName
            };
            this.totalOaMessage[ki+totalLength]={
              mess_receiver:this.evaluationplan_supervisor[ki].user_name,
              mess_type:1,
              mess_link:'/progressTest?evaluationplanTypeId='+this.evaluationplanTypeId+"&evaluationplanTypeName="+this.evaluationplanTypeName
            }
          };
          this.axios.post('/api/v1/flow/companyevaplan',
            {
              evaplan_type_id:this.typeId,
              arr:this.tempArr
            }).then((res)=>{
            console.log(res.data)
            if(res.data.code==0){
              this.$alert(res.data.message,'提示');
              this.multipleSelection=[];
              this.tempArr =[];
              this.putOAmessage(this.totalOaMessage);
              this.axios.post('/api/v1/accout/usermessagebatch',
                {
                  total_messages:total_messages
                },
              )
                .then((res)=>{
                  if(res.data.code==0){
                    this.$alert(res.data.message,'提示',function () {
                      this.$router.push({
                        path:'/progressTest'
                      })
                    })
                  }
                }).then((res)=>{

              })
                .catch((err)=>{
                  this.$alert(err.message,'错误');
                })
            }else{
              this.$alert(res.data.message,'提示')
            }
          })
        }
      },
      putOAmessage(total_messages){
        this.axios.post('/api/v1/accout/externalmessagebatch',{
          total_messages:total_messages
        }).then((res)=>{
          console.log(res.data)
        })
      },
      //change  switch
      changeSwitch(index,value){
        console.log(index,value);
        console.log(this.rowIndex1+'rowIndex1')
        console.log(this.rowIndex2+'rowIndex2')
        this.changeIndex=index;
        console.log(this.multipleSelection)
        console.log(this.tableData2[index])
//          for(var i in this.multipleSelection){
//              if(this.rowIndex1 ==this.rowIndex2){
//                if(this.multipleSelection[i].auditor ==this.tableData2[index].user_id
//                  ||  this.multipleSelection[i].evaluator ==this.tableData2[index].user_id
//                ){
//                  this.$alert('评价人员和审核人员不能是同一个','提示');
//                  this.tableData2[index].isActive="0";
//                  return false
//                }
//              }
//
//          }
        for(var i in this.tableData2){
          this.tableData2[i].isActive ="0";
        };
        this.tableData2[index].isActive ="1";
        this.$set(this.tableData2[index],"isActive","1");
        console.log(this.multipleSelection);
      },
      confirmEditor(form){
        //评价人员和审核人员分开
        console.log(this.tempArr);
        console.log(this.multipleSelection);
        console.log(this.multipleSelection2);

        this.formMenber =this.tableData2[this.changeIndex];
        if(this.tableData2[this.changeIndex]==undefined){
          this.$alert('请选择相关人员','提示');
          return false
        }
        if(this.title=='审核人员'){
//            console.log(this.formatData2[this.rowIndex2])
          console.log(this.rowIndex2)
          console.log(this.formatData2[this.rowIndex2])
          if(this.formatData2[this.rowIndex2].companyevaplan){
            if(this.formatData2[this.rowIndex2].companyevaplan.evaluation_starttime){
              //修改之前的数据
              console.log(this.formatData2[this.rowIndex2].companyevaplan.evaluation_starttime)
              this.formatData2[this.rowIndex2].companyevaplan.auditor =this.formMenber.user_id;
              this.formatData2[this.rowIndex2].companyevaplan.evaluator =this.formatData2[this.rowIndex2].companyevaplan.evaluator;
//                evaluator  评价人员   auditor  审核人员
              if(this.formatData2[this.rowIndex2].companyevaplan.evaluator==this.formMenber.user_id){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                console.log( this.formMenber)
                this.formMenber.isActive="0";
                return false;
              }
              var tempformatData2 =this.formatData2[this.rowIndex2];
              this.$set(this.formatData2,this.rowIndex2,tempformatData2);
            }else if(this.formatData2[this.rowIndex2].companyevaplan.walk_through){
              //修改之前的数据
              this.formatData2[this.rowIndex2].companyevaplan.evaluator=this.formatData2[this.rowIndex2].companyevaplan.evaluator;
              this.formatData2[this.rowIndex2].companyevaplan.auditor=this.formMenber.user_id;
              if(this.formatData2[this.rowIndex2].companyevaplan.evaluator==this.formMenber.user_id){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                this.formMenber.isActive="0";
                return false;
              }
              var tempformatData2 =this.formatData2[this.rowIndex2];
              this.$set(this.formatData2,this.rowIndex2,tempformatData2);
            }
            else{
              console.log(this.formMenber);
              console.log(this.formatData2[this.rowIndex2].companyevaplan.evaluator)
              if(this.formMenber.user_id ==this.formatData2[this.rowIndex2].companyevaplan.evaluator){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                this.formMenber.isActive="0";
                return false;
              }else{

                //先添加了评价人员后添加审核人员  当前没有提交过
                if(this.formatData2[this.rowIndex2].select_type==1){
                  this.formatData2[this.rowIndex2].companyevaplan.auditor=this.formMenber.user_id
                }else{
                  this.formatData2[this.rowIndex2].companyevaplan={
                    auditor:this.formMenber.user_id,
                    evaluator: this.formatData2[this.rowIndex2].companyevaplan.evaluator
                  };
                }
                var tempformatData2 =this.formatData2[this.rowIndex2];
                this.$set(this.formatData2,this.rowIndex2,tempformatData2);
              }
            }
          }else{
            console.log('!!!!!!!!!')
            this.formatData2[this.rowIndex2].companyevaplan={
              auditor:this.formMenber.user_id,
            }
            var tempformatData2 =this.formatData2[this.rowIndex2];
            this.$set(this.formatData2,this.rowIndex2,tempformatData2);
          }
          for(var i in this.multipleSelection){
            for(var k in this.formatData2){
              if(this.multipleSelection[i].index ==this.formatData2[k].index){
                this.multipleSelection[i].auditor =this.formMenber.user_id;
                this.multipleSelection[i].walk_through =this.formMenber.user_id;
              }
            }
          }
          this.dialogFormVisible3 =false;
        }else if(this.title=='评价人员'){
          if(this.formatData2[this.rowIndex1].companyevaplan){
            if(this.formatData2[this.rowIndex1].companyevaplan.evaluation_starttime){
              //修改之前的数据
              this.formatData2[this.rowIndex1].companyevaplan.auditor=this.formatData2[this.rowIndex1].companyevaplan.auditor;
              this.formatData2[this.rowIndex1].companyevaplan.evaluator=this.formMenber.user_id;
              if(this.formatData2[this.rowIndex1].companyevaplan.auditor==this.formMenber.user_id){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                this.formMenber.isActive="0";
                return false;
              }
              var tempformatData2 =this.formatData2[this.rowIndex1];
              this.$set(this.formatData2,this.rowIndex1,tempformatData2);
            }else if(this.formatData2[this.rowIndex1].companyevaplan.walk_through){
              //修改之前的数据
              this.formatData2[this.rowIndex1].companyevaplan.auditor=this.formatData2[this.rowIndex1].companyevaplan.auditor;
              this.formatData2[this.rowIndex1].companyevaplan.evaluator=this.formMenber.user_id;
              if(this.formatData2[this.rowIndex1].companyevaplan.auditor==this.formMenber.user_id){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                this.formMenber.isActive="0";
                return false;
              }
              var tempformatData2 =this.formatData2[this.rowIndex1];
              this.$set(this.formatData2,this.rowIndex1,tempformatData2);
            }
            else{
              //先添加了评价人员后添加审核人员
              //先添加了评价人员后添加审核人员
              if(this.formatData2[this.rowIndex1].companyevaplan.auditor ==this.formMenber.user_id){
                this.$alert('评价人员和审核人员不能是同一个','提示');
                this.formMenber.isActive="0";
                return false;
              }else{
                if(this.formatData2[this.rowIndex1].select_type==1){
                  this.formatData2[this.rowIndex1].companyevaplan.evaluator=this.formMenber.user_id
                }else{
                  this.formatData2[this.rowIndex1].companyevaplan={
                    auditor:this.formatData2[this.rowIndex1].companyevaplan.auditor,
                    evaluator: this.formMenber.user_id
                  };
                }
                var tempformatData2 =this.formatData2[this.rowIndex1];
                this.$set(this.formatData2,this.rowIndex1,tempformatData2);
              }
            }
          }else{
            this.formatData2[this.rowIndex1].companyevaplan={
              evaluator:this.formMenber.user_id
            }
            var tempformatData2 =this.formatData2[this.rowIndex1]
            this.$set(this.formatData2,this.rowIndex1,tempformatData2);
          }
          for(var i in this.multipleSelection){
            for(var k in this.formatData2){
              if(this.multipleSelection[i].index ==this.formatData2[k].index){
                this.multipleSelection[i].evaluator =this.formMenber.user_id
              }
            }
          }

          this.dialogFormVisible3 =false;
        }
        console.log(this.rowIndex1)
        console.log(this.formatData2[this.rowIndex1]);

      },
      tableRowClassName ({row, rowIndex}) {
        //把每一行的索引放进row
        row.index = rowIndex;
      },
      tableRowClassName2 ({row, rowIndex}) {
        //把每一行的索引放进row
        row.index = rowIndex;
      },
      cell({row, column, rowIndex, columnIndex}) {
        //第八列添加 red 类
        if(columnIndex==0||columnIndex==1){
          return "first-table-clouum"
        }
        if(columnIndex == 11){
          return 'walk_through'
        }
        if(columnIndex==12||columnIndex==13){
          return 'commentPerson'
        };

        if(columnIndex==5||columnIndex==6 ||columnIndex==7||columnIndex==8||columnIndex==9){
          return "e-table-align-left"
        }
//        //某一行其中的一个变量applies值如果大于0，并且在第六列，即确定一个具体的单元格需要确定行和列
//        if(parseFloat(row.applies) >0 && columnIndex == 5){
//          return 'red'
//        }
      },
      //添加计划
      addPlan(){
        if(this.checkCompany){
          this.hideUl=false;
          this.dialogFormVisible =true;
          this.commentTitle="添加评价类型"
        }else{
          this.checkCompany =this.company_id;
//            this.$alert('请先选择企业','提示');
//            this.hideUl=false;
        }
      },
      //编辑评价类型表格
      editorPlan(){
        this.hideUl=false;
        this.editorPlanShow =true;
        this.getComentTypeList3(this.editorPage)
      },
      editorPlanList(row,index){
        this.isEditor =true;
        this.commentTitle="编辑评价类型";
        this.dialogFormVisible =true;
        this.commentTypeForm =row;
//          this.getComentTypeList3(page)
        console.log((formatDateTime(row.start_time)));
        var tempArray1=[];
        var tempArray2=[];
        var tempArray1 =(formatDateTime(row.start_time)).split('-');
        var tempArray2 =(formatDateTime(row.end_time)).split('-');
        var start_time="";
        var end_time="";
        for(var i in tempArray1){
          if(i==tempArray1.length-1){
            start_time+=tempArray1[i]
          }else{
            start_time+=tempArray1[i]+","
          }
        };
        for(var k in tempArray2){
          if(k==tempArray2.length-1){
            end_time+=tempArray2[k]
          }else{
            end_time+=tempArray2[k]+","
          }
        };
        this.commentDuration =[new Date(start_time),new Date(end_time)];
        this.evaplan_type =row;
        this.commentTypeForm.bl_year_evaluate =row.bl_year_evaluate;
//        this.commentDuration =[new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)]
      },
      //删除评价类型
      deletePlanList(row,index){
        this.axios.delete('/api/v1/flow/evaplantype/'+`${row.evaplan_type_id}`,
        )
          .then((res)=>{
            if(res.data.code==0){
              console.log(index)
              this.selectTypeArray.splice(index,1)
              this.$alert('删除计划成功','提示');
            }else{
              this.$alert(res.data.message,'提示');
            }
          }).catch((err)=>{
          this.$alert(err.message,'错误');
        })
      },
      //确认添加或者编辑计划按钮
      confirmAddPlan(formName){
        let that =this;
        if(this.isEditor&&this.commentTitle=="编辑评价类型"){
          //编辑状态
          this.$refs[formName].validate((valid) => {
            if (valid) {
              console.log('!!!!!!!!!!');
              this.axios.put('/api/v1/flow/evaplantype/'+`${this.evaplan_type.evaplan_type_id}`,
                {
                  evaplan_type_name:this.commentTypeForm.evaplan_type_name,
                  start_time:this.start_time,
                  end_time:this.end_time,

                },
              )
                .then((res)=>{
                  if(res.data.code==0){
                    this.$alert('修改计划成功','提示');
                    console.log(this.row)
                    console.log(this.index)
                    var arrTemp ={
                      company_id: "5",
                      end_time: "1546963200",
                      evaplan_type_id: "28",
                      evaplan_type_name: "专项计划00",
                      numrow: "1",
                      start_time: "1543766400",
                    };
                    this.dialogFormVisible=false;
                    this.commentDuration =[];
                    this.commentTypeForm={};
                    this.evaplan_type={};
                    this.isEditor=false;
                    this.commentTitle='';
                    this.editorPlanShow =false;
                  }else{
                    this.$alert(res.data.message,'提示');
                    return false;
                  }
                })
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        }else{
          this.$refs[formName].validate((valid) => {
            if (valid) {
              this.axios.post('/api/v1/flow/evaplantype',
                {
                  evaplan_type_name:this.commentTypeForm.evaplan_type_name,
                  start_time:this.start_time,
                  end_time:this.end_time,
                  company_id:this.checkCompany,
                },
              )
                .then((res)=>{
                  if(res.data.code==0){
                    this.$alert('添加计划成功','提示');
                    console.log(res.data.data.evaplan_type_id)
                    this.evaluationplanTypeId=res.data.data.evaplan_type_id;
                    this.selectTypeArray2.push({
                      evaplan_type_name:that.commentTypeForm.evaplan_type_name,
                      evaplan_type_id:res.data.data.evaplan_type_id
                    })
                    this.dialogFormVisible=false;
                    this.commentDuration =[];
                    this.commentTypeForm={};
                    this.commentTitle='';
                  }else{
                    this.$alert(res.data.message,'提示');
                    return false;
                  }
                })
            } else {
              console.log('error submit!!');
              return false;
            }
          });
        }
      },
      canclePlan(){
        this.dialogFormVisible=false;
      },
      //评价人员
      showFormMenbertrue(row,flag,rowIndex){
        if(row.companyevaplan){
          console.log(this.tableData2)
          for(var i in this.tableData2){
            this.tableData2[i].isActive ="0";
            if(row.companyevaplan.evaluator==this.tableData2[i].user_id){
              this.tableData2[i].isActive ="1";
              this.$set(this.tableData2[i],"isActive","1");
            }
          };
        }else{
          for(var i in this.tableData2){
            this.tableData2[i].isActive ="0";
          };
        }
        console.log(row);
        console.log(this.multipleSelection2);
        console.log(this.multipleSelection);
        if((row.select_type==1||row.select_type==true)&&row.bl_evaluation==0&&this.company_pid==0){
          this.rowIndex1= rowIndex;
          this.title ='评价人员';
          this.dialogFormVisible3=true;
          if(this.multipleSelection.length==0){
            for(var p in this.multipleSelection2){
              if(this.multipleSelection2[p].index ==row.index){
                console.log(this.multipleSelection2[p])
                this.multipleSelection[0]=this.multipleSelection2[p];
                this.tempArr.push({
                  prco_id:'',
                  walk_through:'',
                  evaluator:'',
                  auditor:'',
                  evaluation_finishtime:''
                });
                console.log(this.tempArr)
              }
            }
          }else{
//            this.getMenber();
            console.log('~~~~~~~~~~~')
            console.log(this.multipleSelection);
            console.log(this.multipleSelection2);
            console.log('~~~~~~~~~~~~~~~~~~~~');
            for(var i=0;i<this.multipleSelection.length;i++){
              console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
              for(var m in this.multipleSelection2){
                if(row.index==this.multipleSelection2[m].index){
                  if(this.checkArr(this.multipleSelection,this.multipleSelection2,row.index)){
                  }else{
                    this.multipleSelection.push(this.multipleSelection2[m]);
                    this.tempArr.push({
                      prco_id:'',
                      walk_through:'',
                      evaluator:'',
                      auditor:'',
                      evaluation_finishtime:''
                    });
                  }
                };
              }
            }
          }
        }else if(row.disabled&&row.select_type==0){
          //上级公司为下级公司添加任务
          this.title ='评价人员';
          this.setRowIndex1(row,flag,rowIndex);
        }else if(this.self_identify==1&&row.select_type==2){
          this.setRowIndex1(row,flag,rowIndex);
          this.title="评价人员"
        }
        console.log(this.multipleSelection);
        console.log('tempArr');
        console.log(this.tempArr);
      },
      setRowIndex1(row,flag,rowIndex){
        this.rowIndex1= rowIndex;
        this.dialogFormVisible3=true;
        if(this.multipleSelection.length==0){
          for(var p in this.multipleSelection2){
            if(this.multipleSelection2[p].index ==row.index){
              console.log(this.multipleSelection2[p])
              this.multipleSelection[0]=this.multipleSelection2[p];
              this.tempArr.push({
                prco_id:'',
                walk_through:'',
                evaluator:'',
                auditor:'',
                evaluation_finishtime:''
              });
            }
          }
        }else{
//          this.getMenber();
          console.log('~~~~~~~~~~~');
          console.log(this.multipleSelection);
          console.log(this.multipleSelection2);
          console.log('~~~~~~~~~~~~~~~~~~~~');
          for(var i=0;i<this.multipleSelection.length;i++){
            console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
            for(var m in this.multipleSelection2){
              if(row.index==this.multipleSelection2[m].index){
                if(this.checkArr(this.multipleSelection,this.multipleSelection2,row.index)){
                }else{
                  this.multipleSelection.push(this.multipleSelection2[m]);
                  this.tempArr.push({
                    prco_id:'',
                    walk_through:'',
                    evaluator:'',
                    auditor:'',
                    evaluation_finishtime:''
                  });
                }
              };
            }
          }
        }
      },
      setRowIndex2(row,flag,rowIndex){
        this.rowIndex2= rowIndex;
        this.dialogFormVisible3=true;
        if(this.multipleSelection.length==0){
          for(var p in this.multipleSelection2){
            if(this.multipleSelection2[p].index ==row.index){
              console.log(this.multipleSelection2[p])
              this.multipleSelection[0]=this.multipleSelection2[p];
              this.tempArr.push({
                prco_id:'',
                walk_through:'',
                evaluator:'',
                auditor:'',
                evaluation_finishtime:''
              });
            }
          }
        }else{
//          this.getMenber();
          console.log('~~~~~~~~~~~')
          console.log(this.multipleSelection);
          console.log(this.multipleSelection2);
          console.log('~~~~~~~~~~~~~~~~~~~~');
          for(var i=0;i<this.multipleSelection.length;i++){
            console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
            for(var m in this.multipleSelection2){
              if(row.index==this.multipleSelection2[m].index){
                if(this.checkArr(this.multipleSelection,this.multipleSelection2,row.index)){
                }else{
                  this.multipleSelection.push(this.multipleSelection2[m]);
                  this.tempArr.push({
                    prco_id:'',
                    walk_through:'',
                    evaluator:'',
                    auditor:'',
                    evaluation_finishtime:''
                  });
                }
              };
            }
          }
        }
      },
//      穿行测试激活
      activeCxcs(rowIndex){
        if(this.multipleSelection.length==0){
          for(var p in this.multipleSelection2){
            if(this.multipleSelection2[p].index ==rowIndex){
              console.log(this.multipleSelection2[p])
              this.multipleSelection[0]=this.multipleSelection2[p];
              this.tempArr.push({
                prco_id:'',
                walk_through:'',
                evaluator:'',
                auditor:'',
                evaluation_finishtime:''
              });
            }
          }
        }else{
          console.log('~~~~~~~~~~~')
          console.log(this.multipleSelection);
          console.log(this.multipleSelection2);
          console.log('~~~~~~~~~~~~~~~~~~~~');
          for(var i=0;i<this.multipleSelection.length;i++){
            console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
            for(var m in this.multipleSelection2){
              if(rowIndex==this.multipleSelection2[m].index){
                if(this.checkArr(this.multipleSelection,this.multipleSelection2,rowIndex)){
                }else{
                  this.multipleSelection.push(this.multipleSelection2[m]);
                  this.tempArr.push({
                    prco_id:'',
                    walk_through:'',
                    evaluator:'',
                    auditor:'',
                    evaluation_finishtime:''
                  });
                }
              };
            }
          }
        }
      },
      //审核人员
      showFormMenberfalse(row,flag,rowIndex){
        if(row.companyevaplan){
          console.log(this.tableData2)
          for(var i in this.tableData2){
            this.tableData2[i].isActive ="0";
            if(row.companyevaplan.auditor==this.tableData2[i].user_id){
              this.tableData2[i].isActive ="1";
              this.$set(this.tableData2[i],"isActive","1");
            }
          };
        }else{
          for(var i in this.tableData2){
            this.tableData2[i].isActive ="0";
          };
        }
        console.log(row);
        if((row.select_type==1||row.select_type==true)&&row.bl_evaluation==0){
          this.title ='审核人员';
          this.rowIndex2= rowIndex;
          this.dialogFormVisible3=true;
          if(this.multipleSelection.length==0){
            for(var p in this.multipleSelection2){
              if(this.multipleSelection2[p].index ==row.index){
                this.multipleSelection[0]=this.multipleSelection2[p];
                this.tempArr.push({
                  prco_id:'',
                  walk_through:'',
                  evaluator:'',
                  auditor:'',
                  evaluation_finishtime:''
                });
              }
            }
          }else{
            console.log('!!!!!!!!!!!')
            console.log(this.multipleSelection);
            console.log(this.multipleSelection2)
//               this.getMenber();
            console.log('!!!!!!!!!!!');
            for(var i=0;i<this.multipleSelection.length;i++){
              console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
              for(var m in this.multipleSelection2){
                if(row.index==this.multipleSelection2[m].index){
                  if(this.checkArr(this.multipleSelection,this.multipleSelection2,row.index)){
                  }else{
                    this.multipleSelection.push(this.multipleSelection2[m]);
                    this.tempArr.push({
                      prco_id:'',
                      walk_through:'',
                      evaluator:'',
                      auditor:'',
                      evaluation_finishtime:''
                    });
                  }
                };
              }
            }
          }
        }else if(row.disabled&&row.select_type==0){
          //上级公司为下级公司添加任务
          this.title ='审核人员';
          this.setRowIndex2(row,flag,rowIndex);
        }else if(this.self_identify==1&&row.select_type==2){
          this.setRowIndex2(row,flag,rowIndex);
          this.title="审核人员"
        }
        console.log(this.multipleSelection);
        console.log('tempArr');
        console.log(this.tempArr)
      },
      //穿行测试切换
      toggleWalkThrough(row){
        if((row.select_type==1||row.select_type==true)&&row.bl_evaluation==0){
          if(this.multipleSelection.length==0){
            for(var p in this.multipleSelection2){
              if(this.multipleSelection2[p].index ==row.index){
                console.log(this.multipleSelection2[p])
                this.multipleSelection[0]=this.multipleSelection2[p];
                this.tempArr.push({
                  prco_id:'',
                  walk_through:'',
                  evaluator:'',
                  auditor:'',
                  evaluation_finishtime:''
                });
              }
            }
          }else{
            console.log('~~~~~~~~~~~')
            console.log(this.multipleSelection);
            console.log(this.multipleSelection2);
            console.log('~~~~~~~~~~~~~~~~~~~~');
            for(var i=0;i<this.multipleSelection.length;i++){
              console.log('this.multipleSelection.length'+`${this.multipleSelection.length}`)
              for(var m in this.multipleSelection2){
                if(row.index==this.multipleSelection2[m].index){
                  if(this.checkArr(this.multipleSelection,this.multipleSelection2,row.index)){
                  }else{
                    this.multipleSelection.push(this.multipleSelection2[m]);
                    this.tempArr.push({
                      prco_id:'',
                      walk_through:'',
                      evaluator:'',
                      auditor:'',
                      evaluation_finishtime:''
                    });
                  }
                };
              }
            }
          }
        }else if(row.disabled&&row.select_type==0){
          //上级公司为下级公司添加任务
          this.activeCxcs(row.index);
        }else if(this.self_identify==1&&row.select_type==2){
          this.activeCxcs(row.index);
        }
        this.clickIndex=row.index;
        for(var i=0;i<this.multipleSelection.length;i++){
          if(this.multipleSelection[i].index==row.index){
            this.dialogFormVisible4=true;
            var companyevaplan={};
            if(this.formatData2[row.index].companyevaplan){
              companyevaplan={
                walk_through:this.cxcsTemplate.name
              };
              this.formatData2[row.index].companyevaplan.walk_through=this.cxcsTemplate.name;
            }else{
              this.formatData2[row.index].companyevaplan={
                walk_through:this.cxcsTemplate.name
              };
            }
            this.tempArr[i].walk_through=this.cxcsTemplate.name;
          }
        }
      },
      renderHeaderOne (h, {column, $index}) {
        return h('span', [
          h('span', column.label),
          h('span', {
            class: 'addIcon',
            on: {
              click: () => {
//                  alert(this.minLength)
                for(var i in this.formatData2){
                  this.formatData2[i]._expanded=!this.formatData2[i]._expanded
                };
                if(!this.formatData2[0]._expanded){
                  console.log(this.minLength)
                  console.log(this.height)
                  this.$store.commit('changeHeight',{
                    height:((120+this.minLength*50)>(this.height)?this.height:(120+this.minLength*50))
                  })
                }else{
                  var height =document.documentElement.clientHeight||document.body.clientHeight;
                  this.$store.commit('changeHeight',{
                    height:height
                  })
                }
              }
            }
          })
        ])
      },
      renderHeaderTwo (h, {column, $index}) {
        return h('span',{
          class:'choiseManagement',
          on: {
            click: () => {
              console.log(`${column.label}   ${$index}`)
              this.companyForm =true
//              this.showCompany();
            }
          }
        },[
          h('span', column.label),
          h('span', {
            class: 'addIcon2',
          }),
        ])
      },
      confirmOpt(){
        this.dialogFormVisible2 =false
      },
      cancelOpt(){
        this.dialogFormVisible2 =false
      },
      choiseTyoe(){
//        this.getComentTypeList(this.editorPage);
        this.hideUl =!this.hideUl
      },
      selectType(name,id){
        this.loading =true;
        this.categyType = name;
        this.evaluationplanTypeId=id;
        this.evaluationplanTypeName=name;
        this.hideUl =false;
        if(!this.checkCompany){
          this.checkCompany =this.company_id;
        }
        //选定某一个评价类型初始化数据
        this.initData(id);
        this.typeId =id;
//        this.getMenber();

      },
      //获取评价类型列表
      getComentTypeList(page){
        this.axios.get('/api/v1/flow/evaplantype',
          {
            params:{
              company_id:this.checkCompany||this.company_id,
              limit:100,
              page:page
            }
          })
          .then((res)=>{
            if(res.data.code==0){
              console.log(res.data.data);
              this.selectTypeArray2 =res.data.data;
              if(res.data.data.length>0){
                this.loading=true;
                this.categyType =this.selectTypeArray2[0].evaplan_type_name;
                this.evaplan_type_id =this.selectTypeArray2[0].evaplan_type_id;
                this.typeId =this.selectTypeArray2[0].evaplan_type_id;
                this.initData(this.evaplan_type_id);
              }else{
                this.categyType='暂无数据';
                this.tableData3 =[];
              }
            }
          })
//          .then((res)=>{
//              this.initData(this.evaplan_type_id);
//        })
      },
      //获取评价类型列表
      getComentTypeList2(page){
        this.axios.get('/api/v1/flow/evaplantype',
          {
            params:{
              company_id:this.company_id,
              limit:100,
              page:page
            }
          })
          .then((res)=>{
            if(res.data.code==0){
              this.loading =true;
              console.log(res.data.data);
              this.selectTypeArray2 =res.data.data;
              this.pageSize = res.data.pagination.pages;
              if(res.data.data.length>0){
                this.typeId =this.selectTypeArray2[0].evaplan_type_id;
                this.categyType =this.selectTypeArray2[0].evaplan_type_name;
                this.initData(this.selectTypeArray2[0].evaplan_type_id);
              }
              this.judge(this.company_id);
            }
          })
      },
      //初始化及编辑评价类型请求数据
      getComentTypeList3(page){
        this.axios.get('/api/v1/flow/evaplantype',
          {
            params:{
              company_id:this.checkCompany||this.company_id,
              limit:10,
              page:page
            }
          })
          .then((res)=>{
            if(res.data.code==0){
              console.log(res.data.data);
              this.selectTypeArray =res.data.data;
              this.pageSize = res.data.pagination.pages;
            }
          })
      },
      //判断当前账号是否属于该公司
      judge(id){
        this.axios.get('/api/v1/flow/currentcompanyjudge/'+`${id}`
        )
          .then((res)=>{
            if(res.data.code==0){
              console.log(res.data.data);
              this.self_identify =res.data.data.self_identify;
              this.evaluationplan_supervisor =res.data.data.evaluationplan_supervisor
            }
          })
      },
      getMenber(){
        this.axios.get('/api/v1/flow/participantusers/'+`${this.checkCompany||this.company_id}`)
          .then((res)=>{
            if(res.data.code==0){
              for(var i in res.data.data){
                res.data.data[i].isActive="0"
              }
              this.tableData2=res.data.data;
            }
//            console.log(this.tableData2)
          }).catch((res)=>{
          console.log(res)
          this.$alert(res)
        })
      },
      //展示公司列表
      showCompany(){
        this.axios.get('/api/v1/system/comsection?subor=collar')
          .then((res)=>{
            if(res.data.code==0){
              this.formCompany =res.data.data
              console.log(this.formCompany)
            }
          })
      },
      //确定某个公司
      confirmCompany(formName){
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.checkCompany=this.companyData.selectCompany;
            console.log(this.checkCompany);
            this.companyForm =false;
            console.log(this.checkCompany);
            this.judge(this.checkCompany);
            this.getComentTypeList();
            this.getMenber();
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      getCxcsTemplate(pageTemplate){
        this.axios.get('/api/v1/flow/mergetemplate',{
          params:{
            page:pageTemplate,
            limit:10
          }
        }).then((res)=>{
          this.cxscArr =res.data.data
          console.log(res.data.data)
        })
      },
      //获取流程列表
      initData(id){
        this.multipleSelection=[];
        this.tempArr =[];
        this.multipleSelection2=[];
        this.tempArr2 =[];
//        this.tableData3=[];
        var tempi=0;
        this.axios.get('/api/v1/flow/companyevaplan/'+`${id}`)
          .then((res)=>{
            if(res.data.code==0){
//              this.loading =false;
              for(var i in res.data.data){
                res.data.data[i].disabledCheck=false;
              };
              this.minLength =res.data.data.length;
              this.tableData3 =res.data.data;
              var active={
                active:1
              };
              let temp =this.getformatData(res.data.data);
              console.log(temp);
              console.log(this.formatData2)
              for(var i in temp){
//                  console.log(temp[i])
                if((temp[i].select_type==1||temp[i].select_type==2)&&temp[i].bl_evaluation==0){
                  temp[i].active=1;
                  var tempArr={
                    prco_id:'',
                    walk_through:'',
                    evaluator:'',
                    auditor:'',
                    evaluation_finishtime:''
                  };
                  this.tempArr2[tempi]=tempArr;
                  this.multipleSelection2.push(temp[i]);
                  tempi++;

                }
              }
              this.loading =false;
              console.log(this.multipleSelection2)
            }else{
              this.$alert(res.data.message,'提示')
            }
          }).catch((err)=>{
          this.$alert(err.message,'提示')
        })
      },
      showRow: function(row) {
        const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
        row.row._show = show
        return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
      },
      // 切换下级是否展开
      toggleExpanded: function(trIndex) {
        const record = this.formatData2[trIndex]
        record._expanded = !record._expanded
      },
      // 图标显示
      iconShow(index, record) {
        return ( record.son_process && record.son_process.length > 0)
      },
      checkArr(arr1,arr2,tempi){
        for (var i=0; i<arr1.length; i++){
          for (var j=0;j<arr2.length;j++){
            if( arr1[i].index== arr2[j].index&&arr2[j].index==tempi){
              return true;
            }
          }
        }
      },
//      获取所有员工
      getAllUser(){
        this.axios.get('/api/v1/flow/participantusers',{
        })
          .then((res)=>{
            if(res.data.code==0){
              this.userTable =res.data.data;
            }
          }).catch((err)=>{
          this.$alert(err.error,'提示')
        })
      }
    },
    mounted(){
      //通过oa或者其他方式进入到评价计划页面需要自动指定对应的评价类型id

      this.showCompany();
      this.multipleSelection=[];
      this.multipleSelection2=[];
      this.getComentTypeList2(this.editorPage);
      this.getMenber();
      this.getCxcsTemplate(1);
    },
    created(){
      this.getAllUser();
    }
  })
</script>
<style scoped="">
  .planIndex{
    width: 100%;
    height: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding: 10px;
  }
  .planIndex  >>> .e-comment-table .el-table{
    margin-bottom: 30px;
  }
  .planIndex .e-comment-table .el-table  >>>  th.is-leaf{
    background: #d3e9bb;
    height:58px;
  }
  .planIndex  .el-table  >>> thead.is-group th{
    background: #d3e9bb;
  }
  .planIndex  .el-table  >>> thead  th.is-leaf .cell{
    font-size: 14px;
    color: #5d9120;
    font-weight: normal;
  }
  .planIndex  .el-table  >>> thead   .cell .choiseManagement{
    cursor: pointer;
  }
  .planIndex .el-table  >>> tr  th.is-leaf{
    /*border-bottom: 1px solid #aac983;*/
    /*border-right: 1px solid #aac983;*/
  }
  .planIndex  .el-table  >>> .el-table__body-wrapper{
  }
  .planIndex .el-table  >>> .el-table__body-wrapper  .el-table__body  .el-table__row{
    /*height: 50px !important;*/
  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td{
    /*height: 50px !important;*/
    border-right: 1px solid #aac983;
  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum{
    text-align: center;
  }

  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell{
    width: 70px;
  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell .e-operCheck,
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell .nocomments,
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell .e-showCheckBox,
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell .listAppend,
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.first-table-clouum .cell .nocomments{
    text-align: center;
  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td .cell{
    /*height: 42px;*/
    /*vertical-align: middle;*/
    /*line-height: 20px;*/
    /*text-align: center;*/
    /*display: table-cell;*/

  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row td.e-table-align-left .cell{
    text-align: left;
  }
  .planIndex  >>> .el-table   .el-table__body  .el-table__row .cell .lc-text{
    position: relative;
    display: inline-block;
    width: 100%;
  }

  .planIndex  >>> .el-table   .el-table__body  .el-table__row .cell  .el-checkbox__input{
    vertical-align: top;
  }
  .planIndex .el-table >>> .el-table__body-wrapper   .el-table__body  .el-table__row .commentPerson .cell{
    display: inline-block;
    width: 100%;
  }
  .planIndex .el-table >>> .el-table__body-wrapper   .el-table__body  .el-table__row .commentPerson .cell .commentClass{
    display: inline-block;
    width: 100%;
    height: 100%;
    min-height: 23px;
  }
  .planIndex .el-table >>> .el-table__body-wrapper   .el-table__body  .el-table__row .commentPerson .cell span{
    display: inline-block;
    width: 100%;
    height: 100%;
    min-height:23px;
  }
  .planIndex .el-table >>> .el-table__body-wrapper   .el-table__body .first-table-clouum .el-checkbox__inner::after{
    top:2px;
    left: 6px;
    height: 8px;
  }
  .planIndex .el-table >>> .el-table__body-wrapper   .el-table__body tr{
    border-bottom: 1px solid #aac983;
  }

  .editorPlanShow >>> .el-table   span{
    color: #2c63c0;
    text-decoration: underline;
  }
  .planIndex .el-table  >>>  .el-table__header .has-gutter th{
    text-align: center;
  }
  .planIndex .el-table >>>  span.e-ditor{
    margin-right:12px ;
    color: #4577bf;
    text-decoration: underline;
  }
  .planIndex  .el-table >>>  span.d-elete{
    color: #4577bf;
    text-decoration: underline;
    margin-right: 12px;
  }
  .planIndex  .e-table-footer{
    background: #d3e9bb;
    height: 50px;
    line-height: 50px;
    border-top: 1px solid #aac983;
    border-bottom: 1px solid #aac983;
  }
  .planIndex .e-table-footer  .e-selectAll{
    width: 70px;
    text-align: center;
    border-right: 1px solid #aac983;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    display: inline-block;
  }
  .planIndex  .e-table-footer .e-selectText{
    display: inline-block;
    margin-left: 20px;
    color: #5d9120;
  }
  .planIndex  .e-selectText .e-del{
    font-size: 16px;
    color: #fff;
    padding: 6px 20px;
    background: #f56c6c;
    border-radius:2px ;
    -webkit-border-radius: 2px;
    margin-left: 30px;

  }

  .planIndex  .input-with-select{
    display: inline-block;
    width: 260px;
    height: 28px;
    margin-left: 32px;

  }
  .planIndex  .input-with-select >>> .el-input-group__append{
    display: inline-block;
    width: 40px;
    height: 100%;
    line-height: 28px;
    margin-left: 6px;
    border: none !important;
  }
  .planIndex  .input-with-select >>> .el-input__inner{
    display: inline-block;
    width: 170px;
    height: 100%;

  }
  .planIndex .input-with-select  >>> .el-input-group__append{
    position: relative;
  }
  .planIndex .input-with-select  >>> .el-input-group__append .el-button{
    position: absolute;
    left: 0;
    top:0;
    width: 100%;
    height: 100%;
    background: #f2b914;
    margin: 0;
    padding: 0;
    border:none;
  }
  .planIndex .input-with-select  >>> .el-input-group__append .el-button span{
    margin-top: 0;
    background:#f0b914 ;
    padding: 0;
    position: relative;
  }
  .planIndex .input-with-select  >>> .el-input-group__append .el-button span:before{
    position: absolute;
    content: '';
    right:-20px;
    top:50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background-image: url("../../static/images/search.png");
    background-repeat:no-repeat ;
    background-position: center;
  }
  .planIndex  .navList .sp1{
    position: relative;
  }
  .planIndex  .navList .sp1 span{
    position: relative;
  }
  .planIndex  .navList .sp1>span:after{
    position: absolute;
    right: -10px;
    top:50%;
    width:8px;
    height: 5px;
    margin-top: -3px;
    content:'';
    background-image: url("../../static/images/icon-down.png");
    background-repeat: no-repeat;
    background-position: center;

  }
  .planIndex  .navList .sp1 .hideUl{
    position: absolute;
    left: 0;
    top: 46px;
    width: 160px;
    z-index: 999;
    background: white;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    padding-top: 6px;
    border: 1px solid #f2f5fc
    /*overflow-y: scroll;*/

  }
  .planIndex  .navList .sp1 .hideUlWrap{
    overflow-y: scroll;
    min-height: 60px;
    max-height: 400px;
  }
  .planIndex  .navList .sp1 .hideUl:after{
    position: absolute;
    content: '';
    width: 5px;
    height: 10px;
    left: 36px;
    top:-5px;
    margin-left: -2px;
    width: 8px;
    height: 8px;
    border-top: 1px solid #fff;
    border-right: 1px solid #fff;
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    background: white;
  }
  .planIndex  .navList .sp1 .hideUl li{
    height: 34px;
    font-size: 14px;
    line-height: 34px;
    color: #000;
    text-align: center;
  }
  .planIndex  .navList .sp1 .hideUl li:nth-child(1){
    background: #f2f5fc;
  }
  .planIndex  .navList .sp1 .hideUl li:nth-child(1) span{
    color: #7d9bcf;
  }
  .planIndex  .navList .sp1 .hideUl  .nav-editorPlan span, .hideUl .nav-addPlan span{
    color: #fff;
  }
  .planIndex  .navList .sp1 .hideUl  .nav-addPlan{
    background: #adc4e6;
  }
  .planIndex  .navList .sp1 .hideUl  .nav-editorPlan{
    background: #769dd6;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    -webkit-border-bottom-right-radius: 4px;
    -webkit-border-bottom-right-radius: 4px;
    -moz-border-radius-bottomleft: 4px;
    -moz-border-radius-bottomright: 4px;
  }
  .planIndex  .el-table >>> .has-gutter .addIcon{
    display: inline-block;
    width:17px;
    height: 15px;

    margin-left: 6px;

    position: relative
  }
  .planIndex  .el-table >>> .has-gutter .addIcon:before{
    position: absolute;
    content: '';
    left: 0;
    top:65%;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    width: 100%;
    height: 100%;
    background:#afd682 url("../../static/images/add2.png");
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 2px;
    -webkit-border-radius: 2px;
  }
  .planIndex .el-table >>> .has-gutter .addIcon2{
    display: inline-block;
    width:17px;
    height: 15px;
    margin-left: 6px;
    border-radius: 2px;
    -webkit-border-radius: 2px;
    position: relative;
  }
  .planIndex  .el-table >>> .has-gutter .addIcon2:before{
    position: absolute;
    content: '';
    left: 0;
    top:65%;
    width: 100%;
    height: 100%;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    background: #afd682 url("../../static/images/icon-down.png");
    background-repeat: no-repeat;
    background-position: center;
  }
  .planIndex >>> .el-table__body  .el-table__row td .cell .s1 .el-checkbox__inner,
  .planIndex >>> .el-table__body  .el-table__row td .cell .s2 .el-checkbox__inner{
    width: 14px;
    height: 14px;
  }
  .planIndex >>> .el-table__body  .el-table__row td .cell .s2{
    margin-left: 0 !important;
  }
  .planIndex >>> .el-table__body .el-checkbox__inner::after{
    left: 5px;
    width: 4px;
    height: 8px;
    top: 1px;
    -webkit-transform: rotate(45deg) scaleY(1);
    transform: rotate(45deg) scaleY(1);
  }
  .planIndex >>> .el-table__body  .el-checkbox__input .el-checkbox__inner{
    /*background: #d5d5d5;*/
    /*border-color: #d5d5d5;*/
  }
  .planIndex >>> .el-table__body  .el-checkbox__input.is-checked .el-checkbox__inner,
  .planIndex >>> .el-table__body  .el-checkbox__input.is-indeterminate .el-checkbox__inner{
    background: #8bc34a;
    border-color: #8bc34a;
  }
  .planIndex >>> .el-table__body   .el-checkbox__inner:hover{
    border-color: #d5d5d5;
  }
  .planIndex >>> .e-dialoge-editor .el-dialog{
    width: 400px;
  }
  .planIndex >>> .e-dialoge-editor .el-dialog .el-dialog__body{
    padding: 10px 8px;
  }
  ::-webkit-scrollbar {/*滚动条整体样式*/
    width: 8px;     /*高宽分别对应横竖滚动条的尺寸*/
    height: 1px;

  }
  ::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.2);
  }
  ::-webkit-scrollbar-track {/*滚动条里面轨道*/
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.3);
  }
  .planIndex >>> .e-dialoge-editor .el-table    th.is-leaf{
    background: #fff;
    height:46px;

  }
  .planIndex >>> .e-dialoge-editor .el-table  >>> thead.is-group th{
    background: #fff;
  }

  .planIndex >>> .e-dialoge-editor .el-table  >>> tr  th.is-leaf{
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
    /*border-top: 1px solid #aac983;*/
  }

  .planIndex  >>> .e-dialoge-editor .el-table  >>> .el-table__body-wrapper  .el-table__body  .el-table__row{
    height: 30px !important;
  }
  .planIndex >>> .e-dialoge-editor .el-table >>> .el-table__body-wrapper   .el-table__body  .el-table__row td{
    height: 30px;
    /*border-bottom: 1px solid #aac983;*/
    border-right: 1px solid #ccc;
  }
  .planIndex  >>> .e-dialoge-editor .el-table >>> .el-table__body-wrapper   .el-table__body tr{
    border-bottom: 1px solid #ccc;
  }
  .planIndex  >>> .e-dialoge-editor .el-table td,  .planIndex  >>> .e-dialoge-editor .el-table th.is-leaf{
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
  }

  .planIndex  .e-dialoge-editor  .el-table  >>> thead  th.is-leaf .cell{
    color: #606266;
    font-weight: bold;
  }
  .planIndex >>> .e-dialoge-editor .el-dialog__body{
    padding: 0;
  }
  .planIndex >>> .e-dialoge-editor .el-table--border{
    border: 1px solid #ccc;
    border-bottom: 0;
    border-right: 0;
  }
  .planIndex >>> .e-dialoge-editor .dialog-footer .el-button{
    padding: 10px 16px;
    margin-top: 10px;
    /*background: #8cc34b;*/
  }
  .planIndex >>> .e-dialoge-editor .dialog-footer{
    text-align: right;
  }
  .planIndex >>>  .el-date-editor{
    border: none;
    max-width: 100%;
    word-break:break-all
  }
  .planIndex >>>  .el-date-editor .el-range-input{
    width: 35%;
  }
  .planIndex >>>  .el-range-editor.el-input__inner{
    flex-wrap: wrap;
    background: transparent;
  }
  .planIndex >>> .el-date-editor .el-range-input, .planIndex >>> .el-date-editor .el-range-separator{
  }
  .planIndex >>>  .el-date-editor .el-input__inner{
    border: none;
    background: transparent;
  }
  .planIndex >>>  .el-date-editor input{
    background: transparent;
  }
  .planIndex >>> .companyForm{
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top:0;
    background: rgba(0,0,0,0.4);
    z-index: 99999999999;
  }

  .planIndex >>> .companyForm  .confirm-company{
    text-align: center;
  }
  .planIndex >>> .companyForm  .confirm-company .el-button{
    padding: 8px 16px;
  }
  .planIndex >>> .companyForm .fixedUl{
    position: absolute;
    left: 0;
    top:0;
    right: 0;
    bottom: 0;
    margin: auto;
    height: 420px;
    width: 360px;
    background: #fff;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
  }
  .planIndex >>> .companyForm .fixedUl ul{
    height: 360px;
    overflow-y: scroll;
    margin-top: 15px;
  }
  .planIndex >>> .companyForm .fixedUl ul li{
    padding: 6px 20px ;
  }
  .planIndex >>> .companyForm  .e-confirm-wrap{
    text-align: center;
  }
  .planIndex >>> .companyForm  .e-confirm-wrap .el-button{
    padding: 6px 15px;
  }
  .planIndex >>> .companyForm  .el-radio__input.is-checked+.el-radio__label{
    color: #8cc34b;
  }
  .planIndex >>> .companyForm   .el-radio__input.is-checked .el-radio__inner{
    border-color: #8cc34b;
    background: #8cc34b;
  }
  .planIndex >>> .companyForm   .el-form-item__error{
    position: absolute;
    left: 20px;
    top:-10px;
  }
  .planIndex >>> .companyForm    .el-form-item__content{
    line-height: 26px ;
    margin-top: 10px;
  }
  .planIndex >>> .editorPlanShow  .el-dialog .el-dialog__body{
    padding: 5px 20px;
  }
  .planIndex >>> .editorPlanShow .el-dialog .el-table  th.is-leaf{
    height: 42px ;
    background: #d3e9bb;
  }

  .planIndex >>> .editorPlanShow  .el-dialog .el-table td,.planIndex >>> .editorPlanShow  .el-dialog .el-table th{
    padding: 5px 0;
  }
  .planIndex >>> .editorPlanShow  .el-dialog .el-table .el-table__body-wrapper   .el-table__body  .el-table__row td{
    height: 40px;
    /*border-right: 1px solid #aac983;*/
  }
  .planIndex >>> .editorPlanShow  .el-dialog .el-table  .el-table__body-wrapper  .el-table__body  .el-table__row{
    height: 40px !important;
  }
  .planIndex >>> .editorPlanShow  .el-dialog .el-table{
    border-bottom: 1px solid #aac985;
    border-top: 1px solid #aac985;
  }

  .planIndex >>> .el-dialog {
    width: 650px;
  }
  .planIndex >>> .dialog-footer{
    text-align: right;
    padding-right: 60px;
  }
  .planIndex >>>  .el-table__body td.e-table-align-left .cell{
    padding-left: 6px;
    padding-right: 0;
    text-align: left;
  }
  .planIndex >>> .el-table--enable-row-transition .el-table__body td.e-table-align-left .cell .lc-text {
    overflow: hidden;
    width: 100%;
    position: relative;
  }
  .planIndex >>> .el-table--enable-row-transition .el-table__body td.e-table-align-left .cell .lc-text img{
    cursor: pointer;
    position: absolute;
    top:1px;
  }
  .planIndex >>> .el-table .el-table__body td.e-table-align-left .cell .lc-text span{
    margin-left: 20px;
    /*text-align: left;*/
    /*position: absolute;*/
    /*left: 27px;*/
    /*top:14px;*/
  }
  .planIndex  .imitate-e-check{
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    border-radius: 2px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
    cursor: not-allowed;
  }

  .planIndex   .imitate-e-checked:after{
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    -webkit-transform: rotate(45deg) scaleY(1);
    transform: rotate(45deg) scaleY(1);
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    content: "";
    border: 1px solid #fff;
    border-left: 0;
    border-top: 0;
    position: absolute;
    -webkit-transition: -webkit-transform .15s ease-in .05s;
    transition: -webkit-transform .15s ease-in .05s;
    transition: transform .15s ease-in .05s;
    transition: transform .15s ease-in .05s, -webkit-transform .15s ease-in .05s;
    -webkit-transform-origin: center;
    transform-origin: center;
  }
  .planIndex >>> .noComment  .imitate-e-check{
    background: #ccc;
    border:1px solid #c0c4cc
  }
  .planIndex >>> .listAppend .noComment  .no-controPoint{
    background: #ffa800;
    border: 1px solid #ffa800;
  }
  .planIndex >>>  .nocomments .imitate-e-check{
    background: #ccc;
    border:1px solid #c0c4cc
  }
  .planIndex >>>  .nocomments .imitate-e-checked{
    background: #8bc34a;
    border: 1px solid #8bc34a;
  }
  /*.planIndex >>> .noComment  .imitate-e-check{*/
  /*background: #ccc;*/
  /*border:1px solid #c0c4cc*/
  /*}*/
  .planIndex >>> .appendTo  .imitate-e-check .imitate-e-check{
    border:1px solid #c0c4cc
  }
  .planIndex  .imitate-e-check{
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    border-radius: 2px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    cursor: not-allowed;
  }
  .planIndex >>> .appendTo .imitate-e-check{
    background: #ccc;
    border:1px solid #c0c4cc
  }
  .planIndex   >>> .first-table-clouum  .e-showCheckBox  .imitateCheck .imitate-e-check{
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    border-radius: 2px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    cursor: not-allowed;
    border: 1px solid #ccc;
  }
  .planIndex   >>> .first-table-clouum  .e-showCheckBox  .no-controllPoint .imitate-e-check{
    background: #ffa800;
    border: 1px solid #ffa800;
  }
  .planIndex >>> .e-operCheck .imitate-e-check {
    border: 1px solid #ccc;
  }
  .planIndex >>> .e-operCheck  .e-showCheckBox .imitate-e-check {
    border: 1px solid #ccc;
  }
  .planIndex >>> .e-operCheck .imitateCheck .notAllowed{
    background: #ccc;
    border: 1px solid #c0c4cc;
  }
  .planIndex  .imitate-e-checked{
    background: #8bc34a;
    border-color: #8bc34a;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    border: 1px solid #8bc34a;
    border-radius: 2px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }
  .planIndex  .e-operCheck .notAllowModify{
    background: #d77438;
    border: 1px solid #d77438;
  }
  .custmerTips{
    float: right;
  }
  .planIndex >>> .navList .custmerTips{
    background: none;
  }
  .planIndex >>> .navList .custmerTips li{
    margin-right: 5px;
  }
  .planIndex >>> .navList .custmerTips li b{
    font-weight: normal;
    display: inline-block;
    vertical-align: top;

  }
  .planIndex >>> .navList .custmerTips li span{
    background: #fff;
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: inline-block;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 2px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }
  .planIndex >>> .navList .custmerTips li span.hasDone{
    background: #f56c6c;
    border: 1px solid #f56c6c;
  }
  .planIndex >>> .navList .custmerTips li span.permissed{
    background: #8bc34a;
    border: 1px solid #8bc34a;
  }

  .planIndex >>> .navList .custmerTips li span.notAllowed{
    background: #ccc;
    border: 1px solid #c0c4cc;
  }
  .planIndex >>> .navList .custmerTips li span.noControllerPoint{
    background: #ffa800;
    border: 1px solid #ffa800;
  }
  .planIndex >>> .navList .custmerTips li span.notAllowModify{
    background: #d77438;
    border: 1px solid #d77438;
  }
  .planIndex >>> .navList .custmerTips li span:after{
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    -webkit-transform: rotate(45deg) scaleY(1);
    transform: rotate(45deg) scaleY(1);
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    content: "";
    border: 1px solid #fff;
    border-left: 0;
    border-top: 0;
    position: absolute;
    -webkit-transition: -webkit-transform .15s ease-in .05s;
    transition: -webkit-transform .15s ease-in .05s;
    transition: transform .15s ease-in .05s;
    transition: transform .15s ease-in .05s, -webkit-transform .15s ease-in .05s;
    -webkit-transform-origin: center;
    transform-origin: center;
  }
  .planIndex >>> .navList .custmerTips li span.notAllowed:after{
    width: 0;
    height: 0;
    border-color: #ccc;
  }
  .planIndex >>> .navList .custmerTips li span.noControllerPoint:after{
    width: 0;
    height: 0;
    border-color: #ffa800;
  }
  /*已完成*/
  .planIndex .e-operCheck .hasbl_evaluation .has_finished{
    background: #f56c6c;
    border: 1px solid #f56c6c;
  }
  .planIndex >>> .navList .custmerTips ul li{
    float: left;
    color: #333;
  }
  .planIndex   >>> .first-table-clouum  .e-showCheckBox .imitateCheck  .no-controPoint{
    background: #ffa800;
    border: 1px solid #ffa800;
  }
  @media  screen and  (max-width: 1400px){
    .planIndex{
      padding: 6px;
    }
  }
</style>
